package com.cn.wanxi.servlet.back.facebook;

import com.alibaba.fastjson.JSONObject;
import com.cn.wanxi.model.FacebookModel;
import com.cn.wanxi.model.PageModel;
import com.cn.wanxi.service.IFacebookService;
import com.cn.wanxi.service.impl.FacebookServiceImpl;
import com.cn.wanxi.util.DataEncoding;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/back/sort/facebook")
public class FacebookSortServlet extends HttpServlet {
    IFacebookService facebookService = new FacebookServiceImpl();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        DataEncoding.setJsonContentType(resp);
        DataEncoding.setCharacterEncoding(req,resp);
//        //留言分页排序
//        String pageSize = req.getParameter("page");
//        String pageNum = req.getParameter("size");
//        String sort = req.getParameter("sort");
//        int page = Integer.parseInt(pageSize);
//        int size = Integer.parseInt(pageNum);
//        PageModel<FacebookModel> list = facebookService.getFacebooks(page,size,sort);
//        System.out.println(list);
//        JSONObject jsonObject = new JSONObject();
//        jsonObject.put("facebook",list);
//        resp.getWriter().print(jsonObject);
    }
}
